#include <iostream>
#include <memory>
#include "udp_socket.hpp"
  
std::string ToUpper(const std::string &msg)
{
    std::string ret = "hello";
    ret += msg;
    return ret;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cout << "Usage: ./udp_server <IP> <PORT>" << std::endl;
        return 1;
    }
    uint16_t port = static_cast<uint16_t>(std::stoi(argv[1]));
    //  std::string ip = argv[1];

    Enable_Console_Log_Strategy();

    std::unique_ptr<UDPServer> server = std::make_unique<UDPServer>(port,ToUpper);
    server->init();
    server->start();

    return 0;
}
